# -*- coding:utf-8 -*-
# 2022/3/1 15:04
# author:xwl
import datetime

from fastapi import APIRouter, Depends

from backend.app.app.api.api_Xiong.crud.pri_crud import read_data_unit_data, save_data_unit_caldata
from backend.app.app.api.api_save.crud.crud_fun import save_unit_cal_data
from backend.app.app.api.api_save.models.model import save_model
from backend.app.app.api.api_v1.user import verify_token_user

save_router = APIRouter(prefix="/save_router", tags=["另存为"])

@save_router.post("/save", name="另存为")
def save(data: save_model,ver=Depends(verify_token_user)):
    result = save_unit_cal_data(data.UserID, data.Current_ProjID, data.Proj_Name, data.Remark)
    return {
        'result': result,
        'verify': ver
    }